/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.edu.agh.student.logic.dao;

import java.util.List;
import pl.edu.agh.student.model.AbstractEntity;

/**
 *
 * @author janburkot
 */
public interface GenericDao<T extends AbstractEntity> {

    /**
     * Find entity by technical id.
     * 
     * @param id
     *            id
     * @return user
     */
    T find(long id);

    /**
     * Delete the entity out the database.
     * 
     * @param entity
     *            entity
     */
    void delete(T entity);

    /**
     * * Store or update the entity in the database.
     * 
     * @param entity
     *            entity
     * @return
     */
    void saveOrUpdate(T entity);

    void refresh(T entity);
    
    List<T> findAll();
    List<T> findByProperty(String name, Object value);
}
